const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,

  devServer: {
    proxy: {
      '/api': {  // 代理标识，匹配以/api开头的请求
        target: 'http://localhost:8080', // 目标服务器地址
        ws: true,
        changeOrigin: true, // 是否改变请求源
        pathRewrite: {
          '^/api': '' // 路径重写，去掉/api前缀
        }
      }
    }
  }
})
